﻿using RotovapPlatform.Domain.Common.Exceptions;

namespace RotovapPlatform.Domain.Equipment.Interfaces.Base;

/// <summary>
/// 设备基础接口
/// </summary>
public interface IEquipmentBase
{
	/// <summary>
	/// 设备ID
	/// </summary>
	string EquipmentId { get; }

	/// <summary>
	/// 设备名称
	/// </summary>
	string Name { get; }
}

/// <summary>
/// 设备连接接口
/// </summary>
public interface IConnectable
{
	/// <summary>
	/// 设备是否连接
	/// </summary>
	bool IsConnected { get; set; }

	/// <summary>
	/// 连接设备
	/// </summary>
	/// <exception cref="CommunicationException">通信异常</exception>
	Task<bool> ConnectAsync();

	/// <summary>
	/// 断开设备连接
	/// </summary>
	void DisconnectAsync();

	/// <summary>
	/// 检查设备连接状态
	/// </summary>
	/// <returns>连接状态</returns>
	Task<bool> CheckConnectionAsync();
}